package com.smart.manager.work.entities.assembler;

import com.smart.manager.product.entities.enums.PigstyKind;
import com.smart.manager.product.entities.views.BasicPigstyView;
import com.smart.manager.product.entities.views.PropsComboView;
import com.smart.manager.product.entities.views.PropsProfileView;
import com.smart.manager.product.entities.views.PropsServeView;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;


/**
 * 工单
 * @author leo
 * @date 2023/09/19
 */
@Data
@Accessors(chain = true)
public class WorkOrder implements Serializable {




    @Data
    @ApiModel("提交通用")
    public static class SubmitBody implements Serializable {

        @ApiModelProperty("工单ID")
        @NotNull(message = "工单ID 不能为空")
        private Long id;

    }


    /**
     * 入圈工单
     * @author leo
     * @date 2023/09/26
     */
    @Data
    @ApiModel("入圈工单详情")
    public static class EnterTheCircleBody implements Serializable {

        @ApiModelProperty("猪仔id")
        @NotNull(message = "猪仔id 不能为空")
        private Long id;

        @ApiModelProperty("入栏模式")
        private PigstyKind mode;

        @ApiModelProperty("猪仔天数")
        @NotNull(message = "猪仔天数 不能为空")
        @Min(value = 0,message = "猪仔天数不能小于0")
        private Integer day;

        @ApiModelProperty("耳标MAC")
        @NotBlank(message = "耳标MAC 不能为空")
        private String rfid;

        @ApiModelProperty("所属猪圈")
        @NotNull(message = "所属猪圈 不能为空")
        @Valid
        private BasicPigstyView pigsty;

    }


    /**
     * 喂养工单
     * @author leo
     * @date 2023/10/05
     */
    @Data
    @ApiModel("喂养工单详情")
    public static class FeedBody implements Serializable {

        @ApiModelProperty("猪仔id")
        @NotNull(message = "猪仔id 不能为空")
        private Long id;

        @ApiModelProperty("喂食套餐")
        private PropsComboView combo;

        @ApiModelProperty("食物详情")
        private List<PropsProfileView> foods;

        @ApiModelProperty("附加食物")
        private List<AffixList> affix;
    }

    /**
     * 治疗工单的详情
     * @author leo
     * @date 2023/10/05
     */
    @Data
    @ApiModel("治疗工单的详情")
    public static class TreatmentBody implements Serializable {

        @ApiModelProperty("猪仔")
        private Long pigId;

        @ApiModelProperty("治疗内容")
        private String content;

    }

    /**
     * 服务工单详情
     * @author leo
     * @date 2023/10/05
     */
    @Data
    @ApiModel("服务工单详情")
    public static class ServiceTicketBody implements Serializable {

        @ApiModelProperty("事件")
        private PropsServeView combo;

    }



}
